/// author stevenHu
///
/// created by hujintao
/// created at 2021/12/18
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:hk_base/adapter.dart';
/*
LoadingUtils.show(msg: "开始抽奖啦，请稍等~");
  hkSetTimeout(() {
    LoadingUtils.dismiss();
    hkShowToast('恭喜你中奖了~');
  }, Duration(microseconds: 1000));
*/
class LoadingUtils {
  /// spinkit widget
  static Widget widget(BuildContext context, {Color? color, double? size}) {
    return SpinKitThreeBounce(
      color: color ?? Theme.of(context).primaryColor,
      size: size ?? Adapter.setSp(50),
    );
  }

  /// loading tip
  static void show({String msg = '正在请求数据，请稍后...'}) {
    EasyLoading.show(status: msg);
  }

  /// loading dismiss
  static void dismiss() {
    EasyLoading.dismiss();
  }
}
